package com.ocom.app.feignclient;


import com.ocom.common.constant.CompanyServiceUrl;
import com.ocom.common.entity.company.EntityDeviceUserBind;
import com.ocom.common.entity.company.EntityProductSuggestion;
import com.ocom.common.entity.master.EntityMngAccountInfo;
import com.ocom.common.request.company.MngAccountInfoRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.company.GetMngUserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "company")
public interface CompanyFeignClient {

    @GetMapping(CompanyServiceUrl.URL_accountAndRole)
    Result getAccountAndRole(@RequestParam("account") String account, @RequestParam("role") String role);

    @GetMapping("/product_suggestion/list")
    Result productSuggestionList(@RequestParam("comId") Long comId, @RequestParam("userId") Long userId,
                                 @RequestParam("page") int page, @RequestParam("size") int size);

    @GetMapping("/product_suggestion/create")
    Result productSuggestionCreate(@RequestParam Long comId, @RequestBody EntityProductSuggestion entityProductSuggestion);

    @PostMapping(CompanyServiceUrl.URL_GetCompanyListInfoOne)
    Result getCompanyListInfoOne(@RequestParam("companyId") Long companyId);

    @PostMapping(CompanyServiceUrl.URL_account)
    Result selectAccountsByPhone(@RequestBody MngAccountInfoRequest request);

    @GetMapping(CompanyServiceUrl.URL_mainAccountList)
    Result mainAccountList(@RequestParam("comId") Long comId, @RequestParam("deviceId") String deviceId);

    @GetMapping(CompanyServiceUrl.URL_switchAccount)
    Result switchAccount(@RequestParam("comId") Long comId, @RequestParam("userId") String userId, @RequestParam("deviceId") String deviceId);

    @PostMapping(CompanyServiceUrl.URL_mainAccountBindDeviceUserBind)
    Result mainAccountBindDeviceUserBind(@RequestParam("companyId") Long companyId, @RequestBody EntityDeviceUserBind entityDeviceUserBind);

    /**
     * 获取管理员用户信息
     */
    @PostMapping(CompanyServiceUrl.URL_GetMngUserInfo)
    Result GetMngUserInfo(@RequestBody GetMngUserInfoVo getMngUserInfoVo);

    @PostMapping(CompanyServiceUrl.URL_addMngAccount)
    Result addMngAccount(@RequestBody MngAccountInfoRequest mngAccountInfoRequest);

}
